package com.aaa.appUtil.config;

import com.aaa.appUtil.util.InterceptorUtilImpl;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * fileName:LoginConfig
 * description:
 * author:zxh
 * createTime:2020/1/10 15:19
 * version:1.0.0
 */
//@Configuration
public class LoginConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册TestInterceptor拦截器
        InterceptorRegistration interceptorRegistration = registry.addInterceptor(new InterceptorUtilImpl());
        interceptorRegistration.addPathPatterns("/**");  //拦截所有路径
        interceptorRegistration.excludePathPatterns(
                "你的登陆路径",            //登录
                "/**/*.html",            //html静态资源
                "/**/*.js",              //js静态资源
                "/**/*.css",             //css静态资源
                "/**/*.woff",
                "/**/*.ttf"
        );
    }
}
